package reifnsk.minimap;

import java.io.InputStream;
import java.util.Scanner;

class ReiMinimap$1 extends Thread
{
    final ReiMinimap this$0;

    ReiMinimap$1(ReiMinimap var1)
    {
        this.this$0 = var1;
    }

    public void run()
    {
        while (ReiMinimap.access$000(this.this$0) == null)
        {
            try
            {
                Thread.sleep(100L);
            }
            catch (Exception var18)
            {
                ;
            }
        }

        int flag = EnumOption.UPDATE_CHECK.getValue(EnumOptionValue.UPDATE_NOT_FOUND);
        InputStream in = null;

        try
        {
            in = ReiMinimap.access$100(this.this$0).openStream();
            Scanner e = new Scanner(in, "UTF-8");

            while (e.hasNextLine())
            {
                String line = e.nextLine();
                String[] strs = line.split("\\s*,\\s*");

                if (strs.length >= 4)
                {
                    try
                    {
                        int nfe = Integer.decode(strs[0]).intValue();
                        int mcver = Integer.decode(strs[1]).intValue();

                        if (nfe > 197633)
                        {
                            if (mcver == 33621506)
                            {
                                flag = EnumOption.UPDATE_CHECK.getValue(EnumOptionValue.UPDATE_FOUND1);
                                this.this$0.chatInfo(String.format("\u00a7B[%s] Rei\'s Minimap %s update found!!", new Object[] {strs[3], strs[2]}));
                            }
                            else
                            {
                                if (flag == EnumOption.UPDATE_CHECK.getValue(EnumOptionValue.UPDATE_NOT_FOUND))
                                {
                                    flag = EnumOption.UPDATE_CHECK.getValue(EnumOptionValue.UPDATE_FOUND2);
                                }

                                this.this$0.chatInfo(String.format("\u00a79[%s] Rei\'s Minimap %s update found!", new Object[] {strs[3], strs[2]}));
                            }
                        }
                    }
                    catch (NumberFormatException var19)
                    {
                        var19.printStackTrace();
                    }
                }
            }
        }
        catch (Exception var20)
        {
            var20.printStackTrace();
        }
        finally
        {
            ReiMinimap.access$202(this.this$0, flag);

            try
            {
                in.close();
            }
            catch (Exception var17)
            {
                ;
            }
        }
    }
}
